# coding = UTF-8
# DA数转模
import smbus
import time

bus = smbus.SMBus(1)

addr = 0x48
input = 0

while True:
    input+=10
    if input > 255:
        input = 0
    # 0b01000000  允许输出
    # 先写入控制字 control byte 再写数据(0-255范围))
    bus.write_byte_data(addr,0b01000000,input)
    print(input)
    time.sleep(0.5)